package com.tm.util;

/**
 * @author huangp
 * @create 2021-09-13 16:38
 */
public class RestReturnModel {


    private Integer flag;

    private String message;

    private Object data;


    //成功
    public static RestReturnModel SUCCESS(Object obj){
        RestReturnModel r=new RestReturnModel();
        r.flag=RestFlagEnum.SUCCESS_FLAG.FLAG;
        r.message=RestFlagEnum.SUCCESS_FLAG.MESSAGE;
        r.data=obj;
        return r;
    }
    //失败
    public static RestReturnModel ERROR(){
        RestReturnModel r=new RestReturnModel();
        r.flag=RestFlagEnum.SYSTEM_ERROR.FLAG;
        r.message=RestFlagEnum.SYSTEM_ERROR.MESSAGE;
        return r;
    }

    public Integer getFlag() {
        return flag;
    }

    public void setFlag(Integer flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
